package Text1;

import java.util.*;

public class Main {
    static int N = 10010;
    static int[] f = new int[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        f[0] = 1;
        for (int i = 1; i <= n; i++) {
            int a = in.nextInt();
            for (int j = m; j >= a; j--) {
                f[j] += f[j - a];
            }
        }
        System.out.println(f[m]);
    }
}
